import { IsString, IsEmail, IsOptional, Length, MinLength } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';

export class CreateUserDto {
  @ApiProperty({ description: '用户名', maxLength: 32 })
  @IsString()
  @Length(3, 32)
  username: string;

  @ApiProperty({ description: '邮箱', maxLength: 64 })
  @IsEmail()
  email: string;

  @ApiProperty({ description: '手机号', maxLength: 20, required: false })
  @IsOptional()
  @IsString()
  @Length(0, 20)
  phone?: string;

  @ApiProperty({ description: '密码', minLength: 6 })
  @IsString()
  @MinLength(6)
  password: string;
} 